<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<!-- remove old header -->


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cogen API Reference Documentation
        - Class: Socket</title><meta name="MSSmartTagsPreventParsing" content="true" /><meta http-equiv="imagetoolbar" content="no" /><link href="css/default.css" rel="stylesheet" type="text/css" /><link href="css/pygments.css" rel="stylesheet" type="text/css" />
    <!-- <link rel="shortcut icon" href="/images/favicon.ico" type="image/vnd.microsoft.icon"/> -->
    <link rel="stylesheet" href="css/apydia.css" type="text/css" />
    <script src="js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="js/apydia.js" type="text/javascript"></script>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
    <div id="page">
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="cogen.html">cogen</a>
                    </li><li>
                        <a href="cogen.common.html">cogen.common</a>
                    </li><li>
                        <a href="cogen.core.html">cogen.core</a>
                    </li><li>
                        <a href="cogen.core.coroutine.html">cogen.core.coroutine</a>
                    </li><li>
                        <a href="cogen.core.events.html">cogen.core.events</a>
                    </li><li>
                        <a href="cogen.core.pollers.html">cogen.core.pollers</a>
                    </li><li>
                        <a href="cogen.core.queue.html">cogen.core.queue</a>
                    </li><li>
                        <a href="cogen.core.schedulers.html">cogen.core.schedulers</a>
                    </li><li class="active">
                        <a href="cogen.core.sockets.html">cogen.core.sockets</a>
                    </li><li>
                        <a href="cogen.core.util.html">cogen.core.util</a>
                    </li><li>
                        <a href="cogen.web.html">cogen.web</a>
                    </li><li>
                        <a href="cogen.web.async.html">cogen.web.async</a>
                    </li><li>
                        <a href="cogen.web.wsgi.html">cogen.web.wsgi</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.Socket.accept.html">accept</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.bind.html">bind</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.close.html">close</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.connect.html">connect</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.fileno.html">fileno</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.getpeername.html">getpeername</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.getsockname.html">getsockname</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.gettimeout.html">gettimeout</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.listen.html">listen</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.read.html">read</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.readall.html">readall</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.readline.html">readline</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.setblocking.html">setblocking</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.setsockopt.html">setsockopt</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.settimeout.html">settimeout</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.shutdown.html">shutdown</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.write.html">write</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.writeall.html">writeall</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: cogen.core.sockets.Socket</h1>
    <div class="docstring plain">A wrapper for socket objects, sets nonblocking mode and
add some attributes we need:
<ul><li> rl_pending - for unchecked for linebreaks buffer</li><li> rl_list - for checked for linebreaks buffers</li><li> rl_list_sz - a cached size of the summed sizes of rl_list buffers</li></ul>
Regular calls to the usual socket methods return operations for use in a
coroutine.</div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L37">View source</a>
    </li>
</ul>
    <div>
        <h2>Methods</h2>
            <h3 id="method-accept">
                accept
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L72">View source</a>
    </li>
</ul>
            <h3 id="method-bind">
                bind
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L78">View source</a>
    </li>
</ul>
            <h3 id="method-close">
                close
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L75">View source</a>
    </li>
</ul>
            <h3 id="method-connect">
                connect
                <span class="args">(self, addr)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L81">View source</a>
    </li>
</ul>
            <h3 id="method-fileno">
                fileno
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L84">View source</a>
    </li>
</ul>
            <h3 id="method-getpeername">
                getpeername
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L90">View source</a>
    </li>
</ul>
            <h3 id="method-getsockname">
                getsockname
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L93">View source</a>
    </li>
</ul>
            <h3 id="method-gettimeout">
                gettimeout
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L99">View source</a>
    </li>
</ul>
            <h3 id="method-listen">
                listen
                <span class="args">(self, backlog)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L87">View source</a>
    </li>
</ul>
            <h3 id="method-read">
                read
                <span class="args">(self, size)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L57">View source</a>
    </li>
</ul>
            <h3 id="method-readall">
                readall
                <span class="args">(self, size)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L60">View source</a>
    </li>
</ul>
            <h3 id="method-readline">
                readline
                <span class="args">(self, size)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L63">View source</a>
    </li>
</ul>
            <h3 id="method-setblocking">
                setblocking
                <span class="args">(self, val)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L105">View source</a>
    </li>
</ul>
            <h3 id="method-setsockopt">
                setsockopt
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L109">View source</a>
    </li>
</ul>
            <h3 id="method-settimeout">
                settimeout
                <span class="args">(self, to)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L96">View source</a>
    </li>
</ul>
            <h3 id="method-shutdown">
                shutdown
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L102">View source</a>
    </li>
</ul>
            <h3 id="method-write">
                write
                <span class="args">(self, data)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L66">View source</a>
    </li>
</ul>
            <h3 id="method-writeall">
                writeall
                <span class="args">(self, data)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L69">View source</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.3</a>
        </div>
    </div>
</body>
</html>